﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace PAMD.Database
{
   public class TemplateLoader
    {
        public static string Process(string path, Dictionary<string, string> val)
        {
            string str;
            using (StreamReader sr = new StreamReader(path))
            {
                str = sr.ReadToEnd();
            }

            return val.Keys.Aggregate(str, (current, key) => current.Replace(key, val[key]));
        }
    }
}
